﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using Steema.TeeChart;
using Steema.TeeChart.Styles;

using System.Speech;

namespace FACUI.frmDialog
{
    public partial class DemoForm : Form
    {
        public DemoForm()
        {
            InitializeComponent();
            button1.Click += new EventHandler(button1_Click);
            trackBar1.ValueChanged += new EventHandler(trackBar1_ValueChanged);
        }

        void trackBar1_ValueChanged(object sender, EventArgs e)
        {
            Doubles[30] = (double)(trackBar1.Value * 255 + 60);
            Doubles[31] = Doubles[30] + 80;
            Doubles[32] = Doubles[30] + 1120;
            Doubles[33] = Doubles[30] - 30;
            double[] dwav = new double[16];
            CSource.GetWavesLength(Doubles, ref dwav);
            string strTmp = string.Empty;
            foreach (double d in dwav)
            {
                strTmp += string.Format("{0}, {1}, {2}, {3}, {4}, {5}\r\n",trackBar1.Value,Doubles[30],Doubles[31],Doubles[32],Doubles[33],d);
            }
            textBox1.Text += strTmp;
        }
        double[] Doubles = new double[256];
        void button1_Click(object sender, EventArgs e)
        {
            return;
            if (textBox1.Text != string.Empty)
            {
                try
                {
                    Doubles[30] = (double)(trackBar1.Value * 255 + 60);
                    Doubles[31] = Doubles[30] + 80;
                    Doubles[32] = Doubles[30] + 1120;
                    Doubles[33] = Doubles[30] - 30;
                    
                }
                catch (Exception ex) { textBox1.Text += string.Format("\r\n{0}:{1}",ex.Message,ex.StackTrace); }
            }
        }
    
    }
}
